import request from '@/utils/request'

// 查询点赞状态（true 已点赞，false 未点赞）
export function getLikeStatus(postsId, userId) {
  return request({
    url: '/community/likes/status',
    method: 'get',
    params: { postsId, userId }
  })
}

// 切换点赞状态，返回新的点赞数量
export function toggleLike(postsId, userId) {
  return request({
    url: '/community/likes/toggle',
    method: 'post',
    params: { postsId, userId }
  })
}

// 获取点赞数量
export function getLikeCount(postsId) {
  return request({
    url: '/community/likes/count/' + postsId,
    method: 'get'
  })
}


